﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using TWS.Cart.Business;
using TWS.Cart.Data;

public partial class Application_Cart_Administration_Products : System.Web.UI.Page
{
	int delId = -1;
	int categoryId = -1;

    protected void Page_Load(object sender, EventArgs e)
    {
		//If a delete commnad is issued then.
		if (!String.IsNullOrEmpty(Request.QueryString["delId"]))
			delId = Convert.ToInt32(Request.QueryString["delId"]);

		if (delId != -1)
			CartCatProduct.Delete(delId);

		if (!String.IsNullOrEmpty(Request.QueryString["categoryId"]))
			categoryId = Convert.ToInt32(Request.QueryString["categoryId"]);

		if (!IsPostBack)
		{
			CartCatProductCollection p = new CartCatProductCollection().Load();
			GridViewResults.DataSource = p;
			GridViewResults.DataBind();
		}

    }
}
